package com.qianfeng.bob.xiexiaobo.application;

import android.app.Application;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.qianfeng.bob.xiexiaobo.cache.MyCache;

/**
 * Created by Bob on 2015/12/16.
 */
public class MyApplication extends Application {
    private RequestQueue requestQueue;

    private MyCache mCache;
    private int mMaxSize ;
    @Override
    public void onCreate() {
        super.onCreate();
        initData();

    }

    /**
     * 初始化各种数据
     */
    private void initData() {
        //初始化Volley的网络请求
        if (requestQueue == null) {
            requestQueue = Volley.newRequestQueue(this);
        }
        if (mCache==null){
            mCache = new MyCache();
        }
    }
    public  MyCache getMyCache(){
        return  mCache;
    }


    public RequestQueue getRequestQueue(){
        return  requestQueue;
    }
}
